import com.sun.org.apache.xpath.internal.operations.Equals;

import java.util.Scanner;
import java.util.Random;

public class name {
    public static void choose(int n,int[] f,String[] name) {
            for (int j = 1; j <= n; j++) {
                Random random = new Random();
                int RandomnInt = random.nextInt(name.length);
                while(f[RandomnInt] == 1) {
                    RandomnInt = random.nextInt(name.length);
                }
                System.out.println();
                System.out.println("***********************************");
                System.out.println("名单开始滚动......");
                for (int i = 0; i < RandomnInt; i++) {
                    System.out.println(name[i]);
                }
                System.out.println("恭喜" + name[RandomnInt] + "中奖了！");
                System.out.println("第"+j+"轮抽奖完毕，该角色将不在会被抽中！");
                System.out.println("***********************************");
                System.out.println();
                f[RandomnInt] = 1;
            }
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] name = {"美国队长", "钢铁侠", "绿巨人", "蜘蛛侠", "黑寡妇", "鹰眼", "蝙蝠侠", "金刚狼", "泰迦奥特曼", "假面骑士zero one"};
        int[] f = new int[name.length];
        for (int i = 0; i < name.length; i++) f[i] = 0;
        System.out.println("请设置中奖的人数：");
        int n = scanner.nextInt();
        String c = scanner.nextLine();
        System.out.println("点击s开始抽奖！");
        String s = scanner.nextLine();
        if (s.equals("s")) choose(n,f,name);
    }
}
